
/*
 * @Autor: Mr Lu
 * @Version: 1.0
 * @Date: 2019-12-03
 * @LastEditors: OBKoro1
 * @LastEditTime: 2019-12-03
 * @Description:  协同检查首页
 */
<template>
  <div id="TeamWorkCheck" class="p-box">
    <div class="p-return">
      <mu-appbar color="primary" class="lan-header">
        <mu-button icon slot="left" v-close>
          <i class="iconfont angle-left iconangle-left"></i>
          <span class="lan-header-back">返回</span>
        </mu-button>协同检查
      </mu-appbar>
    </div>
    <!-- <div class="p-header shadow">
      <WeatherModule></WeatherModule>
    </div>-->
    <div class="p-content">
      <div class="m-box" v-for="(menu) in menuList" :key="menu.id" >
        <div class="m-title">{{menu.moduleName}}</div>
        <div class="m-content">
          <div class="menu-list">
            <div
              class="menu-item"
              v-for="(mod) in menu.moduleList"
              :key="mod.id"
              @click="skipPage(mod)"
              v-power="mod.power"
            >
              <img :src="mod.src" alt />
              <span>{{mod.name}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import WeatherModule from "@/weather/WeatherModule";
export default {
  name: "TeamWorkCheck",
  components: {
    WeatherModule
  },
  data() {
    return {
      menuList: [
        {
          id: "1",
          moduleName: "工作",
          moduleList: [
            {
              id: "1-1",
              name: "检查任务",
              src: require("#/assets/img/teamWorkCheck/checkTask.png"),
              path: "check",
              power:"checkTask"
            },
            {
              id: "1-2",
              name: "随机检查",
              src: require("#/assets/img/teamWorkCheck/randomCheck.png"),
              path: "randomCheck",
              power:"checkRandom"
            },
            // {
            //   id: "1-3",
            //   name: "本地保存",
            //   src: require("#/assets/img/teamWorkCheck/save.png"),
            //   path: ""
            // }
          ]
        },
        {
          id: "2",
          moduleName: "待办",
          moduleList: [
            {
              id: "2-1",
              name: "检查工作",
              src: require("#/assets/img/teamWorkCheck/checkWork.png"),
              path: "checkList",
              power:"checkWork"
            },
            {
              id: "2-2",
              name: "整改工作",
              src: require("#/assets/img/teamWorkCheck/changeWork.png"),
              path: "rectificationWork",
              power:"checkModify"
            },
            {
              id: "2-3",
              name: "复查工作",
              src: require("#/assets/img/teamWorkCheck/reaptWork.png"),
              path: "reviewList",
              power:"checkReview"
            },
            {
              id: "2-4",
              name: "审批工作",
              src: require("#/assets/img/teamWorkCheck/approvalWork.png"),
              path: "approveList",
              power:"checkApproval"
            },
            {
              id: "2-5",
              name: "抄送信息",
              src: require("#/assets/img/teamWorkCheck/copyMessage.png"),
              path: "copyToInfo",
              power:"checkCopy"
            },
            {
              id: "2-6",
              name: "整改单",
              src: require("#/assets/img/teamWorkCheck/changeMenu.png"),
              path: "punchLists",
              power:"chekTips"
            }
          ]
        },
        {
          id: "3",
          moduleName: "台账",
          moduleList: [
            {
              id: "3-1",
              name: "任务台账",
              src: require("#/assets/img/teamWorkCheck/taskLedger.png"),
              path: "taskParameter",
              power:"checkTaskParamter"
            },
            {
              id: "3-2",
              name: "检查台账",
              src: require("#/assets/img/teamWorkCheck/checkLedger.png"),
              path: "checkareaList",
              power:"checkParamter"
            },
            {
              id: "3-3",
              name: "问题台账",
              src: require("#/assets/img/teamWorkCheck/proLedger.png"),
              path: "questionParameter",
              power:"checkQues"
            },
            {
              id: "3-4",
              name: "预警台账",
              src: require("#/assets/img/teamWorkCheck/warningLedger.png"),
              path: "warringParameter",
              power:"checkWarn"
            },
            {
              id: "3-5",
              name: "审批台账",
              src: require("#/assets/img/teamWorkCheck/approvalWorkLedger.png"),
              path: "approvalAccount",
              power:"checkApprovalParamter"
            },
            {
              id: "3-6",
              name: "整改单台账",
              src: require("#/assets/img/teamWorkCheck/changeLedger.png"),
              path: "accountareaList",
              power:"checkNotice"
            }
          ]
        }
      ]
    };
  },
  computed: {},
  created() {
    this.$nextTick(()=>{
      this.handemptyDOM('m-box','menu-item');
    })
  },
  mounted() {},
  watch: {},
  methods: {
    handemptyDOM(box,testDom){
      let el = document.getElementsByClassName(box)
      if(el.length){
        for(let i=0;i<el.length;i++){
          let str = el[i].innerHTML+'';
          if(str.indexOf(testDom) === -1){
            el[i].style.display = "none";
          }
        }
      }
    },
    skipPage(item) {
      this.$router.push({
        name: item.path
      });
    }
  },
  destroyed() {}
};
</script>

<style lang="scss">
#TeamWorkCheck {
}
</style>
